home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: Does Borland C++ 5.0 still work with normal C???
- Message-ID: <1996Feb19.213738.3008@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <4gag3n$a5u@wormer.fn.net>
- Date: Mon, 19 Feb 1996 21:37:38 GMT
-
- In article <4gag3n$a5u@wormer.fn.net>, joakley@wichita.fn.net (Jess J Oakley) writes:
- >n4mwd@magg.net (Dennis Hawkins) wrote:
- >
- >>Does anybody know if the new Borland C++ compiler will compile normal C?? In
- >>my opinion, if it doesn't, it is worthless. I recently received a flyer from
- >>Borland and there was no mention of being able to compile C.
- >
- >Probably so, Since as far as I know anything written in C is legal
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- >within a C++ program.
- ^^^^^^^^^^^^^^^^^^^^^
-
-
- Oh, I would not make such a radical statement! :-) See the following
- for a simple and trivial (albeit made up to show how such comments are
- dangerous) counter-example:
-
- zodiac{3544}szh: cat foo.c
- #include <stdio.h>
-
- int main ( int argc , char *argv[] )
- {
- int new = 10;
-
- printf ( "new is %d\n" , new );
- }
- zodiac{3545}szh: cp foo.c foo.cpp
- zodiac{3546}szh: gcc -o foo foo.c
- zodiac{3547}szh: foo
- new is 10
- zodiac{3548}szh: g++ -o foo foo.cpp
- foo.cpp: In function `int main(int, char **)':
- foo.cpp:5: parse error before `new'
- foo.cpp:7: parse error before `)'
-
-
- >Obviously it wouldn't be a "TRUE" C++ program.
-
-
- I guess not! :-)
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-